package sk.stuba.fiit.pki.dao;

import java.math.BigInteger;
import java.util.Collection;
import java.util.List;

import org.springframework.dao.DataAccessException;

import sk.stuba.fiit.pki.entity.CertificateEntity;

/**
 * Certificate DAO interface.
 * 
 * @author Marek Hruska
 */
public interface CertificateDao {

    /**
     * Find certificates.
     */
    public Collection<CertificateEntity> findCertificates() throws DataAccessException;
    
    /**
     * Saves certificates.
     */
    public void save(CertificateEntity certificateEntity);
    
    
    /**
     * Delete certificate.
     */
    public void delete(CertificateEntity certificateEntity);
    
    /**
     * Find certifcate by id.
     * @param issuer 
     */
    public CertificateEntity findCertificateBySerialNumber(BigInteger id, String issuer) throws DataAccessException;

	public List<CertificateEntity> findRevocateCertificate();

	public CertificateEntity findCertificateBySubjectIssuer(String subject);
}

